﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
namespace Utils
{
    public class Hash
    {
        public static string MD5(string text)
        {
            MD5 md5 = new MD5CryptoServiceProvider();
            string hash = string.Empty;
            byte[] chips = md5.ComputeHash(Encoding.Unicode.GetBytes(text));
            foreach (byte chip in chips)
            {
                hash += chip.ToString("X2");
            }

            return hash;
        }

    }
}
